package cn.bugstack.springframework.beans.factory.support;

import java.util.HashMap;
import java.util.Map;

import cn.bugstack.springframework.beans.factory.config.SingletonBeanRegistry;

/**
 * description:
 * taskId：
 * <pre>
 * change history:
 * date             defect#             person                comments
 * ---------------------------------------------------------------------
 * 2024/12/31       ********         zhaochaoyue        create file
 * </pre>
 *
 * @author: zhaochaoyue
 * @date: 2024/12/31 15:18
 * @copyright: 2024
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    
    private Map<String,Object> singletonObjects = new HashMap<>();
    
    
    @Override
    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }
    
    protected void addSingleton(String beanName,Object singletonObject){
        singletonObjects.put(beanName, singletonObject);
    }
}
